<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--       
*     Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
*     Use is subject to license terms.
-->
<html>
<head>
	<title>Preparing JavaFX Applications for Deployment</title>
<link href="nbdocs:/org/netbeans/modules/usersguide/ide.css"  rel="stylesheet" type="text/css">
</head>
<body>
<h2>Preparing JavaFX Applications for Deployment </h2>
<p> <small><a href="#seealso">See Also</a>&nbsp; </small> 


<p>Using the Project Properties dialog, you can configure your JavaFX application to execute using one of the available execution models: Standard Execution (standalone), Web Start Execution, Run in Browser,  Run in Mobile Emulator (Microsoft Windows and Mac platforms only), and Run in TV Emulator (Microsoft Windows only). The Standard Execution model is chosen by default. After you choose the execution model and you build the project, the IDE creates the necessary files and executes the application locally. The files created can then be used to package the application for deployment outside of the IDE. </p>
<p>Alternatively, you can choose the execution model by selecting it from the combo box on the Run toolbar. Open the combo box and select one of the following:</p>
<ul>
	<li>&lt;default&gt; for the Standard Execution.</li>
    <li>Browser for Run in Brower execution model.</li>
    <li>Mobile for Run in Mobile Emulator execution model.</li>
    <li>TV for Run in TV Emulator execution model.</li>
  <li>Web Start for the Web Start Execution.</li>
</ul>
<p><b>To run a standalone application using Standard Execution model: </b></p>
<ol>
      <li>In the Projects window, right-click your project's root node and select Properties.<br>
      Alternatively, you can select the project in the Projects window and select File &gt; Project Properties (<i>JavaFX_project_name</i>) from the main menu.      </li>
      <li>In Project Properties dialog, select the Run category.</li>
      <li>Select the Standard Execution execution model.</li>
      <li>Click OK.</li>
  <li>In the Projects window, right-click the project's root node and  select Run Project.
        <br>
  The IDE compiles the project and creates the necessary class files in the project's <code>dist</code> folder. If successful, a separate window appears running your application.
</ol>
<p>Alternatively, you can  choose the Standard Execution model by  selecting  &lt;default&gt; from the combo box on the Run toolbar.</p>
<p><b>To run a standalone application from the command line: </b></p>
<ol>
	<li>Navigate to the project's <code>dist</code> folder.</li>
  <li>Type the following at the command prompt: <br>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>javafx -jar &lt;application_jar_name&gt;.jar</code><br>
		or<br>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>javafx -classpath <i>application_jar_name.jar main_JavaFX_class_name</i></code></li>
</ol>
<p><b>To run an application using the Java Web Start execution model:</b>
<ol>
<li>In the Projects window, right-click your project's root node and select Properties.<br>
  Alternatively, you can select the project in the Projects window and select File &gt; Project Properties (<i>JavaFX_project_name</i>) from the main menu.  </li>
<li>(Optional) If your application requires access to any secured computer resources or secured Java classes and methods, do the following steps:</li>
<ol type="a">
<li>In Project Properties dialog, select the Application  category.</li>
<li>Under the Web Start Specific Properties section, select the  Self Signed JAR and the Pack200 Compression check boxes.</li>
</ol>
<li>In the Categories pane, select the Run category and select the  Web Start Execution radio button on the right pane.</li>
<li>Click OK.</li>
<li>In the Projects window, right-click the project's node again and select Run Project.<br>
    The IDE builds the project first, adds the following files to your project's <code>dist</code> folder, and then executes the project.
      <ul>
    <li><code><i>&lt;app-name&gt;</i>.html</code> - sample HTML page with the applet</li>
	<li><code><i>&lt;app-name&gt;</i>_browser.jnlp</code> - JNLP descriptor file for JNLP-based Applet</li>
    <li><code><i>&lt;app-name&gt;</i>.jnlp</code> - JNLP descriptor for direct WebStart execution</li>
    <li><code><i>&lt;app-name&gt;</i>.jar</code> - application JAR file 
    <li><code><i>&lt;app-name&gt;</i>.pack.gz</code> - Pack200 compressed application JAR file (if Pack200 option is set)</li>
    <li><code>lib</code> folder with user libraries necessary for execution and, optionally, with Pack200-compressed user libraries.</li>
    </ul>
</ol>
<p>Alternatively, you can  choose the Java Web Start execution model by  selecting  Web Start from the combo box on the Run toolbar.</p>
<p><b>To run a standalone application with Java Web Start: </b></p>
Do one of the following after you build the application for Java Web Start execution:
<ul>
	<li>Navigate to the project's <code>dist</code> folder and double-click the <code>launch.jnlp</code> file.</li>
  <li></code>Navigate to the project's <code>dist</code> folder and type the following at the command prompt:<br>
		  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>javaws &lt;<i>app-name</i>&gt;.jnlp </code></li>

	</li>
</ul>
<p><b>To run a JavaFX application in a web browser:</b>

<ol>
  <li>In the Projects window, right-click your project's root node and select Properties.<br>
  Alternatively, you can select the project in the Projects window and select File &gt; Project Properties (<i>JavaFX_project_name</i>) from the main menu. </li>
  <li>In Project Properties dialog, select the Application category.</li>
  <li>Under the Applet Specific Properties section, set the desired width and height to use for your applet. The default is 200 pixels by 200 pixels.</li>
  <li>(Optional) Unselect  the Draggable Applet checkbox, if desired. It is selected by default. <br>
    This option allows your application to be dragged form the web browser to the desktop, if your browser has the correct version of the Java Runtime Environment (JRE) that supports this feature. </li>
  <li>In the Categories pane, select the Run category.</li>
  <li>Select the Run in Browser radio button.</li>
  <li>Click OK.</li>
  <li>In the Projects window, right-click the project's root node again and select Run Project.
    <br>
    Your system's default web browser appears, respond to the questions in the dialogs that appear, and the application executes. 
</ol>
<p>Alternatively, you can  choose  the Run in Browser execution model by  selecting  Browser from the combo box on the Run toolbar.</p>
<p><b>To run a JavaFX applet outside of the IDE: </b></p>
<ul>
	<li>Navigate to the project's <code>dist</code> folder and double-click the the <code><i>&lt;projectname&gt;</i>.html</code> file.</li>
</ul>
<p><b>To run an application in the Mobile Emulator: </b></p>
<ol>
  <li>In the Projects window, right-click your project's root node and select Properties.<br>
    Alternatively, you can select the project in the Projects window and select File &gt; Project Properties (<i>JavaFX_project_name</i>) from the main menu. </li>
  <li>In Project Properties dialog, select the Run category.</li>
  <li>Select the Run in Mobile Emulator radio button.</li>
  <li>Click OK.</li>
  <li>In the Projects window, right-click the project's root node again and select Run Project.</li>
</ol>
<p>Alternatively, you can  choose  the Run in Mobile Emulator execution model by  selecting  Mobile from the combo box on the Run toolbar.</p>
<dl>
<dt><a name="seealso">See Also</a></dt>
<dd><a href="../about_javafx.html">About JavaFX Applications</a></dd>
<dd><a href="../run/javafx_run_app.html">Running  JavaFX Applications</a></dd>
<dd><a href="../project/javafx_proj_process.html">Working with JavaFX Projects </a></dd>
</dl>

<hr>
<p><font size=-2><a href="../credits.html">Legal Notices</a></font>
</p>
<table cellpadding="50" border="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

</body>
</html>
